//
//  ViewController.m
//  NSTimerDemo
//
//  Created by lianglibao on 2018/11/13.
//  Copyright © 2018年 lianglibao. All rights reserved.
//

#import "ViewController.h"
#import "ATTwoViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"ONE";
    [self setupSubviews];
}

- (void)setupSubviews {
    [self.view addSubview:({
        UIButton *jumpBtn = [UIButton new];
        [jumpBtn addTarget:self action:@selector(jumpTwoVC) forControlEvents:UIControlEventTouchUpInside];
        [jumpBtn setTitle:@"跳转到Two VC" forState:UIControlStateNormal];
        [jumpBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [jumpBtn sizeToFit];
        jumpBtn.backgroundColor = [UIColor lightGrayColor];
        CGSize screenSize = [UIScreen mainScreen].bounds.size;
        jumpBtn.center = CGPointMake(screenSize.width/2.0, screenSize.height/2.0);
        jumpBtn;
    })];
}

- (void)jumpTwoVC {
    ATTwoViewController *twoVC = [ATTwoViewController new];
    [self.navigationController pushViewController:twoVC animated:YES];
}

@end
